package org.jeecg.modules.demo.weixin.api;

import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.demo.weixin.api.fallback.WeixinHelloFallback;
import org.jeecg.modules.demo.weixin.dto.SpiltOrderDto;
import org.jeecg.modules.demo.weixin.entity.MerchantPay;
import org.jeecg.modules.demo.weixin.entity.PayOrder;
import org.jeecg.modules.demo.weixin.entity.SmtDev;
import org.jeecg.modules.demo.weixin.entity.SmtStoredValueUsers;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.List;

@FeignClient(value = "jeecg-weixin", fallbackFactory = WeixinHelloFallback.class)
public interface WeixinHelloApi {

    /**
     * weixin hello 微服务接口
     *
     * @param
     * @return
     */
    @GetMapping(value = "/weixin/hello")
    String callHello();

    @GetMapping(value = "/weixin/smtoncecardusers/smtOnceCardUsers/queryCount")
    Integer queryCount(@RequestParam("uid") Integer uid, @RequestParam String merId);

    /**
     * 生成代理商
     *
     * @param merchantPay
     */
    @PostMapping(value = "/weixin/merchantpay/merchantPay/updateSpecial")
    void updateSpecial(@RequestBody MerchantPay merchantPay);


    /**
     * 查询商家信息是否填写
     *
     * @param merId
     */
    @GetMapping(value = "/weixin/merchantpay/merchantPay/querySpecial")
    MerchantPay querySpecial(@RequestParam String merId);

    @GetMapping(value = "/weixin/smtstoredvalueusers/smtStoredValueUsers/queryValueCount")
    List<SmtStoredValueUsers> queryValueCount(@RequestParam(name = "userId", required = true) Integer userId, @RequestParam(name = "merId", required = true) String merId);


    /**
     * 查询用户点卡数据
     *
     * @param uid
     * @param merId
     * @return
     */
    @GetMapping(value = "/weixin/smtstoreduserpoint/smtStoredUserPoint/queryPoint")
    BigDecimal queryPoint(@RequestParam Integer uid, @RequestParam String merId);


    /**
     * 创建门店时候创建子商户表
     */
    @GetMapping(value = "/weixin/merchantpay/merchantPay/add")
    Result<String> add(@RequestBody MerchantPay merchantPay);

    @GetMapping(value = "/weixin/smtdev/smtDev/queryDev")
    List<SmtDev> queryDev(@RequestParam(name = "userId", required = true) Integer userId);


    @GetMapping(value = "/weixin/smtdev/smtDev/updateDev")
    void updateDev(@RequestParam(name = "userId", required = true) Integer userId, @RequestParam(name = "merId", required = true) String merId);


    @PostMapping(value = "/weixin/payorder/payOrder/splitOrder")
    Result<PayOrder> splitOrder(@RequestBody SpiltOrderDto spiltOrderDto);

}
